package org.stu.tp.dao;

import java.util.List;

import org.hibernate.Session;
import org.stu.tp.dto.Phone;
import org.stu.tp.util.HibernateUtil;

public class PhoneDao {
	@SuppressWarnings("unchecked")
	public static Phone getContact(String recordName){
		Phone phone=new Phone();
		Session session = HibernateUtil.currentSession();
		List <Phone> userList=session.createSQLQuery("select * from phone where RecordName="+"'"+recordName+"'").addEntity(Phone.class).list();
		phone=userList.get(0);
		HibernateUtil.closeSession();
		return phone;
	}
}
